using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.Serialization;
using System.Web.Script.Serialization;
using System.Xml.Serialization;
using XCode;
using XCode.Configuration;
using XCode.DataAccessLayer;

namespace UIWindows.Entitys
{
    /// <summary>生产数据</summary>
    [Serializable]
    [DataObject]
    [Description("生产数据")]
    [BindTable("ProductionData", Description = "生产数据", ConnName = "MySql", DbType = DatabaseType.None)]
    public partial class ProductionData
    {
        #region 属性
        private Int32 _ID;
        /// <summary>编号</summary>
        [DisplayName("编号")]
        [Description("编号")]
        [DataObjectField(true, true, false, 0)]
        [BindColumn("ID", "编号", "")]
        public Int32 ID { get => _ID; set { if (OnPropertyChanging("ID", value)) { _ID = value; OnPropertyChanged("ID"); } } }

        private Int32 _Station;
        /// <summary>工位</summary>
        [DisplayName("工位")]
        [Description("工位")]
        [DataObjectField(false, false, false, 0)]
        [BindColumn("Station", "工位", "")]
        public Int32 Station { get => _Station; set { if (OnPropertyChanging("Station", value)) { _Station = value; OnPropertyChanged("Station"); } } }

        private String _Eligibility;
        /// <summary>是否合格</summary>
        [DisplayName("是否合格")]
        [Description("是否合格")]
        [DataObjectField(false, false, true, 64)]
        [BindColumn("Eligibility", "是否合格", "")]
        public String Eligibility { get => _Eligibility; set { if (OnPropertyChanging("Eligibility", value)) { _Eligibility = value; OnPropertyChanged("Eligibility"); } } }

        private String _PairNG;
        /// <summary>配对NG</summary>
        [DisplayName("配对NG")]
        [Description("配对NG")]
        [DataObjectField(false, false, true, 64)]
        [BindColumn("PairNG", "配对NG", "")]
        public String PairNG { get => _PairNG; set { if (OnPropertyChanging("PairNG", value)) { _PairNG = value; OnPropertyChanged("PairNG"); } } }

        private String _ButtonNG;
        /// <summary>按键NG</summary>
        [DisplayName("按键NG")]
        [Description("按键NG")]
        [DataObjectField(false, false, true, 64)]
        [BindColumn("ButtonNG", "按键NG", "")]
        public String ButtonNG { get => _ButtonNG; set { if (OnPropertyChanging("ButtonNG", value)) { _ButtonNG = value; OnPropertyChanged("ButtonNG"); } } }

        private String _VoiceNG;
        /// <summary>语音NG</summary>
        [DisplayName("语音NG")]
        [Description("语音NG")]
        [DataObjectField(false, false, true, 64)]
        [BindColumn("VoiceNG", "语音NG", "")]
        public String VoiceNG { get => _VoiceNG; set { if (OnPropertyChanging("VoiceNG", value)) { _VoiceNG = value; OnPropertyChanged("VoiceNG"); } } }

        private DateTime _TestTime;
        /// <summary>测试时间</summary>
        [DisplayName("测试时间")]
        [Description("测试时间")]
        [DataObjectField(false, false, true, 0)]
        [BindColumn("TestTime", "测试时间", "")]
        public DateTime TestTime { get => _TestTime; set { if (OnPropertyChanging("TestTime", value)) { _TestTime = value; OnPropertyChanged("TestTime"); } } }

        private Double _InfraredAccuracy;
        /// <summary>红外精度</summary>
        [DisplayName("红外精度")]
        [Description("红外精度")]
        [DataObjectField(false, false, false, 0)]
        [BindColumn("InfraredAccuracy", "红外精度", "")]
        public Double InfraredAccuracy { get => _InfraredAccuracy; set { if (OnPropertyChanging("InfraredAccuracy", value)) { _InfraredAccuracy = value; OnPropertyChanged("InfraredAccuracy"); } } }

        private Double _InfraredIntensity;
        /// <summary>红外强度</summary>
        [DisplayName("红外强度")]
        [Description("红外强度")]
        [DataObjectField(false, false, false, 0)]
        [BindColumn("InfraredIntensity", "红外强度", "")]
        public Double InfraredIntensity { get => _InfraredIntensity; set { if (OnPropertyChanging("InfraredIntensity", value)) { _InfraredIntensity = value; OnPropertyChanged("InfraredIntensity"); } } }

        private Double _DynamicCurrent;
        /// <summary>动态电流</summary>
        [DisplayName("动态电流")]
        [Description("动态电流")]
        [DataObjectField(false, false, false, 0)]
        [BindColumn("DynamicCurrent", "动态电流", "")]
        public Double DynamicCurrent { get => _DynamicCurrent; set { if (OnPropertyChanging("DynamicCurrent", value)) { _DynamicCurrent = value; OnPropertyChanged("DynamicCurrent"); } } }

        private Double _QuiescentCurrent;
        /// <summary>静态电流</summary>
        [DisplayName("静态电流")]
        [Description("静态电流")]
        [DataObjectField(false, false, false, 0)]
        [BindColumn("QuiescentCurrent", "静态电流", "")]
        public Double QuiescentCurrent { get => _QuiescentCurrent; set { if (OnPropertyChanging("QuiescentCurrent", value)) { _QuiescentCurrent = value; OnPropertyChanged("QuiescentCurrent"); } } }
        #endregion

        #region 获取/设置 字段值
        /// <summary>获取/设置 字段值</summary>
        /// <param name="name">字段名</param>
        /// <returns></returns>
        public override Object this[String name]
        {
            get
            {
                switch (name)
                {
                    case "ID": return _ID;
                    case "Station": return _Station;
                    case "Eligibility": return _Eligibility;
                    case "PairNG": return _PairNG;
                    case "ButtonNG": return _ButtonNG;
                    case "VoiceNG": return _VoiceNG;
                    case "TestTime": return _TestTime;
                    case "InfraredAccuracy": return _InfraredAccuracy;
                    case "InfraredIntensity": return _InfraredIntensity;
                    case "DynamicCurrent": return _DynamicCurrent;
                    case "QuiescentCurrent": return _QuiescentCurrent;
                    default: return base[name];
                }
            }
            set
            {
                switch (name)
                {
                    case "ID": _ID = value.ToInt(); break;
                    case "Station": _Station = value.ToInt(); break;
                    case "Eligibility": _Eligibility = Convert.ToString(value); break;
                    case "PairNG": _PairNG = Convert.ToString(value); break;
                    case "ButtonNG": _ButtonNG = Convert.ToString(value); break;
                    case "VoiceNG": _VoiceNG = Convert.ToString(value); break;
                    case "TestTime": _TestTime = value.ToDateTime(); break;
                    case "InfraredAccuracy": _InfraredAccuracy = value.ToDouble(); break;
                    case "InfraredIntensity": _InfraredIntensity = value.ToDouble(); break;
                    case "DynamicCurrent": _DynamicCurrent = value.ToDouble(); break;
                    case "QuiescentCurrent": _QuiescentCurrent = value.ToDouble(); break;
                    default: base[name] = value; break;
                }
            }
        }
        #endregion

        #region 字段名
        /// <summary>取得生产数据字段信息的快捷方式</summary>
        public partial class _
        {
            /// <summary>编号</summary>
            public static readonly Field ID = FindByName("ID");

            /// <summary>工位</summary>
            public static readonly Field Station = FindByName("Station");

            /// <summary>是否合格</summary>
            public static readonly Field Eligibility = FindByName("Eligibility");

            /// <summary>配对NG</summary>
            public static readonly Field PairNG = FindByName("PairNG");

            /// <summary>按键NG</summary>
            public static readonly Field ButtonNG = FindByName("ButtonNG");

            /// <summary>语音NG</summary>
            public static readonly Field VoiceNG = FindByName("VoiceNG");

            /// <summary>测试时间</summary>
            public static readonly Field TestTime = FindByName("TestTime");

            /// <summary>红外精度</summary>
            public static readonly Field InfraredAccuracy = FindByName("InfraredAccuracy");

            /// <summary>红外强度</summary>
            public static readonly Field InfraredIntensity = FindByName("InfraredIntensity");

            /// <summary>动态电流</summary>
            public static readonly Field DynamicCurrent = FindByName("DynamicCurrent");

            /// <summary>静态电流</summary>
            public static readonly Field QuiescentCurrent = FindByName("QuiescentCurrent");

            static Field FindByName(String name) => Meta.Table.FindByName(name);
        }

        /// <summary>取得生产数据字段名称的快捷方式</summary>
        public partial class __
        {
            /// <summary>编号</summary>
            public const String ID = "ID";

            /// <summary>工位</summary>
            public const String Station = "Station";

            /// <summary>是否合格</summary>
            public const String Eligibility = "Eligibility";

            /// <summary>配对NG</summary>
            public const String PairNG = "PairNG";

            /// <summary>按键NG</summary>
            public const String ButtonNG = "ButtonNG";

            /// <summary>语音NG</summary>
            public const String VoiceNG = "VoiceNG";

            /// <summary>测试时间</summary>
            public const String TestTime = "TestTime";

            /// <summary>红外精度</summary>
            public const String InfraredAccuracy = "InfraredAccuracy";

            /// <summary>红外强度</summary>
            public const String InfraredIntensity = "InfraredIntensity";

            /// <summary>动态电流</summary>
            public const String DynamicCurrent = "DynamicCurrent";

            /// <summary>静态电流</summary>
            public const String QuiescentCurrent = "QuiescentCurrent";
        }
        #endregion
    }
}